<%@ page language="java"  pageEncoding="UTF-8"%>

<%@include file="include.jsp" %>

<script type="text/javascript">
	$(document).ready(function(){ 
		//$("#tableId").addClass("active");
		//弹出一个iframe层
		$('.tableName').on('click', function(){
			  layer.open({
				  type: 2,
				  title: '表详情信息',
				  maxmin: true,
				  //shadeClose: true, //点击遮罩关闭层
				  closeBtn: [0, false],
				  //area : ['800px' , '520px'],
				  area: [($(window).width()/2)+'px', ($(window).height() - 150) +'px'],
				  content: 'table_list.jsp'
			  });
		});
		
		
		 $('#myTabs a').click(function (e) {
			  var controls=$(this).attr("aria-controls");
			  if(controls=="tableManagement"){
				  window.location.href="${basePath}sqlScriptController?executeMethod=queryTableList";
				  //$('#myTabs a[href="#tableManagement"]').tab('show') // Select tab by name
				  $("#tableId").addClass("active");
				  $("#tableId").sublings().removeClass("active");
			  }
			  if(controls=="viewManagement"){
				  window.location.href="${basePath}sqlScriptController?executeMethod=queryViewList";
				  //$('#myTabs a[href="#viewManagement"]').tab('show') // Select tab by name
				  $("#viewId").addClass("active");
				  $("#viewId").sublings().removeClass("active");
			  }
			  if(controls=="sequenceManagement"){
				  window.location.href="${basePath}sqlScriptController?executeMethod=querySequenceList";
				  //$('#myTabs a[href="#viewManagement"]').tab('show') // Select tab by name
				  $("#seqId").addClass("active");
				  $("#seqId").sublings().removeClass("active");
			  }
			  if(controls=="indexManagement"){
				  window.location.href="${basePath}sqlScriptController?executeMethod=queryIndexList";
				  //$('#myTabs a[href="#viewManagement"]').tab('show') // Select tab by name
				  $("#indexId").addClass("active");
				  $("#indexId").sublings().removeClass("active");
			  }
			  e.preventDefault();
			  $(this).tab('show');
		}) 
	});
	
	
	</script>
	
</head>


<body>
 <body style="border:1px solid #ccc;">
			 
   <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist" id="myTabs">
    <li id="tableId" role="presentation" class="active"><a href="#tableManagement" aria-controls="tableManagement" role="tab" data-toggle="tab">表管理</a></li>
    <li id="viewId" role="presentation"><a href="#viewManagement" aria-controls="viewManagement" role="tab" data-toggle="tab">视图管理</a></li>
    <li id="seqId" role="presentation"><a href="#sequenceManagement" aria-controls="sequenceManagement" role="tab" data-toggle="tab">序列管理</a></li>
    <li id="indexId" role="presentation"><a href="#indexManagement" aria-controls="indexManagement" role="tab" data-toggle="tab">索引管理</a></li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
  		<!-- 表管理 -->
   		 <div role="tabpanel" class="tab-pane active" id="tableManagement">
		<!--     	<div class="Morinda-form-title"> <h3><span class="glyphicon glyphicon-volume-up Morinda-fgcolor-secondary-0"></span>数据库集成工具</h3></div> -->
					<form action="${basePath}sqlScriptController?executeMethod=queryTableList" method="post" >
					<!-- panel-success浅绿色 -->
					<div class="panel panel-info">
						<div class="panel-heading" id="divSearchTitle">
							<span class="glyphicon glyphicon-search"></span> 搜索条件
							<span id="divSlide" class="glyphicon glyphicon-chevron-up" style="float: right;"></span>
						</div>
						<div class="panel-body" id="divSearch">
							<table class="Morinda-table">
								<tr class="Morinda-row">
									<td class="Morinda-label-td">
										表名：
									</td>
									<td class="Morinda-field-td">
										<input type="text" name="tableName" value="${tableName}" placeholder="请输入表名" />
									</td>
									<td class="Morinda-label-td"> </td>
									<td colspan="3" style="text-align: center">
										<input type="submit" value="查询" class="btn btn-info" id="btnTabSearch">
										<input type="reset" value="清空" class="btn btn-info" id="btnClear">
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
		     	 <div class="panel panel-success">
		     		<div class="panel-heading">
		   				<button class="btn btn-info"  id="btnModify">修改</button>
		   				<button class="btn btn-info"  id="btnInsert">添加</button>
		    		</div>	
		    		<!-- panel-body begin -->
		     		<div class="panel-body" id="grid-container" style="padding:0px;">
		     			<div class="table-responsive">
						  <table class="table table-striped table-condensed">
						  	<tr>
						  		<th class="Morinda-field-td">序列</th>
						  		<th class="Morinda-field-td">表名</th>
						  		<th class="Morinda-field-td">操作</th>
						  	</tr>
						  		 <c:forEach items="${tableList}" var="obj" varStatus="vs">
								  	<tr>
								  		<td>${vs.index+1}</td>	
							  			<td class="Morinda-field-td"><a class="tableName">${obj.table_name}</a> </td>
							  			<td class="Morinda-field-td"><a>生成脚本</a></td>
								  	</tr>
						  		</c:forEach>  
						  	
						  </table>
						</div>
		     		</div>
		     		<!-- panel-body end -->
		 	   </div> 
    </div>
     <!-- 视图管理 -->
    <div role="tabpanel" class="tab-pane" id="viewManagement">
    	<form action="${basePath}sqlScriptController?executeMethod=queryViewList" method="post" >
					<!-- panel-success浅绿色 -->
					<div class="panel panel-info">
						<div class="panel-heading" id="divSearchTitle">
							<span class="glyphicon glyphicon-search"></span> 搜索条件
							<span id="divSlide" class="glyphicon glyphicon-chevron-up" style="float: right;"></span>
						</div>
						<div class="panel-body" id="divSearch">
							<table class="Morinda-table">
								<tr class="Morinda-row">
									<td class="Morinda-label-td">
										视图名：
									</td>
									<td class="Morinda-field-td">
										<input type="text" name="tableName" value="${tableName}" placeholder="请输入视图名称" />
									</td>
									<td class="Morinda-label-td"> </td>
									<td colspan="3" style="text-align: center">
										<input type="submit" value="查询" class="btn btn-info" id="btnViewSearch">
										<input type="reset" value="清空" class="btn btn-info">
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
    			<div class="panel panel-success">
		     		<div class="panel-heading">
		   				<button class="btn btn-info"  id="btnModify">修改</button>
		   				<button class="btn btn-info"  id="btnInsert">添加</button>
		    		</div>	
		    		<!-- panel-body begin -->
		     		<div class="panel-body" id="grid-container" style="padding:0px;">
		     			<div class="table-responsive">
						  <table class="table table-striped table-condensed">
						  	<tr>
						  		<th class="Morinda-field-td">序列</th>
						  		<th class="Morinda-field-td">视图名称</th>
						  		<th class="Morinda-field-td">操作</th>
						  	</tr>
						  		 <c:forEach items="${viewList}" var="obj" varStatus="vs">
								  	<tr>
								  		<td>${vs.index+1}</td>	
							  			<td class="Morinda-field-td"><a class="viewName">${obj.view_name}</a> </td>
							  			<td class="Morinda-field-td"><a>生成脚本</a></td>
								  	</tr>
						  		</c:forEach>  
						  	
						  </table>
						</div>
		     		</div>
		     		<!-- panel-body end -->
		 	   </div>
    </div>
    
    <!-- 序列管理 -->
    <div role="tabpanel" class="tab-pane" id="sequenceManagement">
    		<form action="${basePath}sqlScriptController?executeMethod=querySequenceList" method="post" >
					<!-- panel-success浅绿色 -->
					<div class="panel panel-info">
						<div class="panel-heading" id="divSearchTitle">
							<span class="glyphicon glyphicon-search"></span> 搜索条件
							<span id="divSlide" class="glyphicon glyphicon-chevron-up" style="float: right;"></span>
						</div>
						<div class="panel-body" id="divSearch">
							<table class="Morinda-table">
								<tr class="Morinda-row">
									<td class="Morinda-label-td">
										序列名：
									</td>
									<td class="Morinda-field-td">
										<input type="text" name="sequenceName" value="${sequenceName}" placeholder="请输入序列名称" />
									</td>
									<td class="Morinda-label-td"> </td>
									<td colspan="3" style="text-align: center">
										<input type="submit" value="查询" class="btn btn-info" id="btnSeqSearch">
										<input type="reset" value="清空" class="btn btn-info">
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
    
    			<div class="panel panel-success">
		     		<div class="panel-heading">
		   				<button class="btn btn-info"  id="btnModify">修改</button>
		   				<button class="btn btn-info"  id="btnInsert">添加</button>
		    		</div>	
		    		<!-- panel-body begin -->
		     		<div class="panel-body" id="grid-container" style="padding:0px;">
		     			<div class="table-responsive">
						  <table class="table table-striped table-condensed">
						  	<tr>
						  		<th class="Morinda-field-td">序列</th>
						  		<th class="Morinda-field-td">序列名称</th>
						  		<th class="Morinda-field-td">操作</th>
						  	</tr>
						  		 <c:forEach items="${sequencesList}" var="obj" varStatus="vs">
								  	<tr>
								  		<td>${vs.index+1}</td>
							  			<td class="Morinda-field-td"><a >${obj.sequence_name}</a> </td>
							  			<td class="Morinda-field-td"><a>生成脚本</a></td>
								  	</tr>
						  		</c:forEach>  
						  	
						  </table>
						</div>
		     		</div>
		     		<!-- panel-body end -->
		 	   </div>
   </div>
    
    
    <div role="tabpanel" class="tab-pane" id="indexManagement">
    	<form action="${basePath}sqlScriptController?executeMethod=queryIndexList" method="post" >
					<!-- panel-success浅绿色 -->
					<div class="panel panel-info">
						<div class="panel-heading" id="divSearchTitle">
							<span class="glyphicon glyphicon-search"></span> 搜索条件
							<span id="divSlide" class="glyphicon glyphicon-chevron-up" style="float: right;"></span>
						</div>
						<div class="panel-body" id="divSearch">
							<table class="Morinda-table">
								<tr class="Morinda-row">
									<td class="Morinda-label-td">
										索引名称：
									</td>
									<td class="Morinda-field-td">
										<input type="text" name="sequenceName" value="${sequenceName}" placeholder="请输入索引名称" />
									</td>
									<td class="Morinda-label-td"> </td>
									<td colspan="3" style="text-align: center">
										<input type="submit" value="查询" class="btn btn-info" id="btnIndexSearch">
										<input type="reset" value="清空" class="btn btn-info">
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
    
    			<div class="panel panel-success">
		     		<div class="panel-heading">
		   				<button class="btn btn-info"  id="btnModify">修改</button>
		   				<button class="btn btn-info"  id="btnInsert">添加</button>
		    		</div>	
		    		<!-- panel-body begin -->
		     		<div class="panel-body" id="grid-container" style="padding:0px;">
		     			<div class="table-responsive">
						  <table class="table table-striped table-condensed">
						  	<tr>
						  		<th class="Morinda-field-td">序列</th>
						  		<th class="Morinda-field-td">表名称</th>
						  		<th class="Morinda-field-td">序列名称</th>
						  		<th class="Morinda-field-td">操作</th>
						  	</tr>
						  		 <c:forEach items="${indexList}" var="obj" varStatus="vs">
								  	<tr>
								  		<td>${vs.index+1}</td>	
								  		<td class="Morinda-field-td"><a >${obj.table_name}</a> </td>
							  			<td class="Morinda-field-td"><a >${obj.index_name}</a> </td>
							  			<td class="Morinda-field-td"><a>生成脚本</a></td>
								  	</tr>
						  		</c:forEach>  
						  	
						  </table>
						</div>
		     		</div>
		     		<!-- panel-body end -->
		 	   </div>
    
    
    </div>
    
  </div>

  
		
			 
  		 
</body>
</html>